<template>
  <div>
    name:{{ this.$store.state.name }}
    age:{{ this.$store.state.age }}

    <el-button @click='setMsg'>set</el-button>
    <el-button @click='getMsg'>get</el-button>
  </div>
</template>
<script>
export default {
  data() {
    return {}
  },
  methods: {
    setMsg() {
      this.$store.commit('setMsg', 'this is a book')
    },
    getMsg() {
      console.log(this.$store.state.msg)
    }
  }
}
</script>
